<template>
  <section>

    <el-tabs v-model="selPage" @tab-click="selPageBtn">
      <el-tab-pane label="所有挂号" name="allRegister">
        <el-table :data="registerList">
          <el-table-column prop="name" label="标题">
          </el-table-column>
          <el-table-column prop="userName" label="用户">
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <el-tab-pane label="挂号类型" name="sourceType">
    </el-tab-pane>
    </el-tabs>

    <el-pagination v-show="totalPage>0" style="margin-top:10px;"
                   background
                   layout="prev, pager, next"
                   :page-count="totalPage"
                   @current-change="goPage">

    </el-pagination>
  </section>
</template>

<script>
  import {mapGetters, mapActions, mapMutations} from 'vuex';
  import errHandler from '@/assets/errHandler.js'

  export default {
    name: "registerFee",
    data(){
      return{
        selPage:'allRegister',
        totalPage:0,
        registerList:[]
      }
    },
    created() {
      //获取所有挂号
      this.getRegisterList()
    },
    methods:{
      ...mapActions({
        fetch: 'fetch'
      }),
      goPage(val){
        this.getRegisterList(val-1)
      },
      selPageBtn(a,b){
        console.log(a,b)
      },
      getRegisterList(pageNo){
        this.fetch({name:"getRegisterList",data:{page:pageNo?pageNo:0}})
          .then(res=>{
            console.log(res)
            this.registerList = res.content
          })
          .catch(err=>{
            console.log(err)
            errHandler.handle(this,err)
          })
      }
    }
  }
</script>

<style scoped>

</style>
